<!-- 子系统列表 -->
<template>
    <div>
        <navigation-bar customTitle="子系统列表">
            <div class="searchContent"></div>
        </navigation-bar>
        <div style="padding: 0 10px">
            <table-index
                :dataSource="dataSource"
                :tableColumns="tableColumns"
                :btnList="[]"
                :pageSize="pageSize"
                :pageCount="pageCount"
                :pageNo="pageNo"
                @pageChange="pageChange"
                :showPage="false"
                @handleCurrentChange="handleCurrentChange"
                :height="secondTableHeight"
            ></table-index>
        </div>
    </div>
</template>

<script>
import customDialog from '@/components/customComponents/customDialog'
import customButton from '@/components/customComponents/customForm/customButton'
import formIndex from '@/components/customComponents/customForm/formIndex'
import tableIndex from '@/components/customComponents/customeTable/iviewTable/singleViewTable'
import navigationBar from '@/components/customComponents/managementCenter/navigationBarCustomTitle'
import {AjaxCommon} from '@/libs/apiCommon'
import {PopupCommon} from '@/libs/popupCommon'
export default {
    components: {
        navigationBar,
        customButton,
        tableIndex,
        customDialog,
        formIndex
    },
    data() {
        return {
            secondTableHeight: document.body.clientHeight - 170,
            dataSource: [],
            tableColumns: [
                {
                    key: 'name',
                    title: '系统名称'
                }
                // {
                //     key: 'function',
                //     title: '系统功能描述'
                // }
            ],
            pageSize: 100,
            pageCount: 100,
            pageNo: 1
            // table 相关参数  end
        }
    },
    created() {},
    methods: {
        getHeight() {
            this.secondTableHeight = document.body.clientHeight - 170
        },
        handleCurrentChange(d) {
            this.$emit('handleCurrentChange', d)
        },
        // 分页点击事件
        pageChange(p) {
            this.pageNo = p
            this.initPage()
        },
        // 初始化事件
        initPage() {
            let self = this
            const params = `?PageSize=${this.pageSize}&PageIndex=${this.pageNo}`
            AjaxCommon(`/api/Menu/GetSysPageData${params}`, 'get', null).then((res) => {
                console.log(res, 'res...........')
                if (res?.data?.Code == 200) {
                    const data = res?.data.Message
                    self.dataSource = data?.rows
                } else {
                    PopupCommon.notify('error', res?.data?.msg)
                }
            })
        }
    },
    mounted() {
        this.$nextTick(() => {
            this.getHeight()
            this.initPage()
        })

        /*窗口自适应，关键代码*/
        window.onresize = () => {
            this.getHeight()
        }
    }
}
</script>

<style></style>



















